# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Stéphane Gaudreault <stephane@archlinux.org>
# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>

pkgbase=python-egenix-mx-base
pkgname=('python2-egenix-mx-base')
pkgver=3.2.9
pkgrel=1
pkgdesc="A collection of Python tools"
arch=('i686' 'x86_64')
license=('custom')
url="http://www.egenix.com/products/python/mxBase/"
makedepends=('python2-setuptools')
conflicts=('python-egenix-mx-base<=3.2.4-1')
replaces=('python-egenix-mx-base<=3.2.4-1')
source=(http://downloads.egenix.com/python/egenix-mx-base-${pkgver}.tar.gz)
sha1sums=('7bce0d094e3e95376d921217ddf44d4491e8c96f')

prepare() {
  cd egenix-mx-base-${pkgver}
  find . -name \*.py -exec sed -i -e "s|^#!.*python|#!/usr/bin/python2|" {} \;
}

build() {
  cd egenix-mx-base-${pkgver}
  python2 setup.py build
}

package_python2-egenix-mx-base() {
  depends=('python2')

  cd egenix-mx-base-${pkgver}
  python2 setup.py install --root="${pkgdir}" --skip-build --optimize=1
  chmod 644 "${pkgdir}"/usr/lib/python2.7/site-packages/mx/{URL/Doc/mxURL.pdf,DateTime/Doc/mxDateTime.pdf}
  install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
